<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <head>
        <title>TODO supply a title</title>
    </head>
    <h:body>
        <ui:composition template="/resources/template/myTemplate.xhtml">
            <ui:define name="content">             
                <c:set var="registered" scope="view" value="#{userManagedBean.registered}"/>
                <c:if test="${registered}">   
                    <h:form>
                        <h3>Bank acount info</h3>
                        <p:messages id="messages" globalOnly="false" showDetail="false" autoUpdate="true" /> 
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Bank name : "/>
                            <h:outputText value="#{bankAccManagedBean.bankAcc.bankName}"/>

                            <h:outputLabel value="SWIFT : "/>
                            <h:outputText value="#{bankAccManagedBean.bankAcc.swift}"/>

                            <h:outputLabel value="Account number : "/>
                            <h:outputText value="#{bankAccManagedBean.bankAcc.accNum}"/>

                            <h:outputLabel value="Currency : "/>
                            <h:outputText value="#{bankAccManagedBean.bankAcc.currency.shortName}"/>

                            <h:outputLabel value="Correspondent bank : "/>
                            <h:outputText value="#{bankAccManagedBean.bankAcc.correspondentBank}"/>

                            <p:commandButton value="Go to update" action="/pages/bankacc/updatebankacc.xhtml?faces-redirect=true"/>
                            <p:commandButton value="Delete" action="#{bankAccManagedBean.doDeleteBankAcc()}"/>
                        </h:panelGrid>
                    </h:form>
                </c:if>
                <c:if test="${!registered}">
                    Dear costumer you don`t have acces to this part of service. Please log-in or register.
                </c:if>
            </ui:define>

        </ui:composition>
    </h:body>
</html>